import matplotlib.pyplot as plt

epochs = [i + 1 for i in range(10)]
sgd = [91.63, 97.97, 98.55, 98.87, 99.07, 99.16, 99.24, 99.34, 99.42, 99.53]  # 测试集：98.74
dpsgd = [49.76, 86.88, 89.78, 90.57, 91.18, 91.10, 91.16, 90.85, 90.47, 91.39]  # 测试集：90.47
accuracy_no_noise = [26.68, 36.48, 45.26, 60.33, 72.46, 75.32, 77.02, 84.25, 87.99, 89.63]  # 测试集：88.86
accuracy_dp_noise = [25.88, 37.91, 45.82, 49.83, 52.21, 55.67, 60.92, 64.60, 67.38, 70.40]  # 测试集：69.48
accuracy_mdp_noise = [24.22, 36.80, 38.12, 39.86, 42.31, 44.71, 47.93, 50.91, 51.96, 53.57]  # 测试集：53.53
accuracy_cov = [20.55, 27.78, 31.26, 37.26, 40.06, 42.61, 46.44, 54.53, 66.50, 71.34]  # 测试集：70.11
accuracy_std = [18.55, 41.35, 46.32, 52.12, 57.93, 62.71, 66.08, 68.11, 69.45, 71.81]  # 测试集：70.37
accuracy_both = [20.53, 26.74, 30.71, 35.80, 39.83, 44.59, 48.75, 53.32, 59.74, 69.51]  # 测试集：68.64

plt.xlabel('epoch')
plt.ylabel('accuracy')

# plt.plot(epochs, sgd, '-o')
# plt.plot(epochs, dpsgd, '-^')
# plt.legend(['SGD', 'DPSGD'])

# plt.plot(epochs, accuracy_no_noise, '-o')
# plt.plot(epochs, accuracy_dp_noise, '-^')
# plt.plot(epochs, accuracy_mdp_noise, '-+')
# plt.legend(['no noise', 'dp noise', 'mdp noise'])

plt.plot(epochs, accuracy_mdp_noise, '-+')
plt.plot(epochs, accuracy_cov, '-s')
plt.plot(epochs, accuracy_std, '-v')
plt.plot(epochs, accuracy_both, '-d')
plt.legend(['fixed cov and std', 'adaptive cov', 'adaptive std', 'adaptive cov and std'])

plt.show()
